<template>
  <div class="buttonItem">
    <el-col :span="1.5" v-for="(item,index) in button" :key="index">
      <el-button v-if="item==='新增'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleMethods('新增')">新增</el-button>
      <el-button v-if="item==='修改'" type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleMethods('修改')">修改</el-button>
      <el-button v-if="item==='删除'" type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleMethods('删除')">删除</el-button>
      <el-button v-if="item==='导出'" type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading" @click="handleMethods('导出')">导出</el-button>
    </el-col>
  </div>
</template>

<script>
export default {
  name: 'buttonItem',
  props: ['button'],
  data() {
    return {
      single: true,
      multiple: true,
      exportLoading: false
    }
  },
  methods: {
    handleMethods(item) {
      this.$emit('handleMethods', item)
    },
  }
}
</script>